package com.homegoods.orderinfodetail.model;

import android.os.Parcel;
import android.os.Parcelable;

import com.alibaba.fastjson.annotation.JSONField;
import com.homegoods.orderinfodetail.item.SpeclistItem;
import com.kedll.library.adapter.MultiTypeAdapter;
import com.kedll.library.mvp.BaseModel;
import com.kedll.library.util.Log;

import java.math.BigDecimal;

/**
 * @author QiQi
 * @ClassName: SpeclistBean
 * @date 2018/9/22
 * @description
 */
public class SpeclistBean extends BaseModel<SpeclistItem> implements Parcelable {
    private String spename;
    private long marketprices;
    //用于点击获取数据，进行分组
    private String superSpeName;
    private boolean isSelected = false;

    public String getSuperSpeName() {
        return superSpeName;
    }

    public void setSuperSpeName(String superSpeName) {
        this.superSpeName = superSpeName;
    }

    public String getSpename() {
        return spename;
    }

    public void setSpename(String spename) {
        this.spename = spename;
    }

    public long getMarketprices() {
        return marketprices;
    }

    public void setMarketprices(long marketprices) {
        this.marketprices = marketprices;
    }

    public boolean isSelected() {
        return isSelected;
    }

    public void setSelected(boolean selected) {
        isSelected = selected;
    }

    @Override
    public SpeclistItem createItem(MultiTypeAdapter adapter) {
        return new SpeclistItem(this, adapter);
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(this.spename);
        dest.writeLong(this.marketprices);
        dest.writeString(this.superSpeName);
        dest.writeByte(this.isSelected ? (byte) 1 : (byte) 0);
    }

    public SpeclistBean() {
    }

    protected SpeclistBean(Parcel in) {
        this.superSpeName = in.readString();
        this.spename = in.readString();
        this.marketprices = in.readLong();
        this.isSelected = in.readByte() != 0;
    }

    public static final Parcelable.Creator<SpeclistBean> CREATOR = new Parcelable.Creator<SpeclistBean>() {
        @Override
        public SpeclistBean createFromParcel(Parcel source) {
            return new SpeclistBean(source);
        }

        @Override
        public SpeclistBean[] newArray(int size) {
            return new SpeclistBean[size];
        }
    };
}
